﻿using System.Collections.ObjectModel;
using Indigo.Quibbler.Data;

namespace Indigo.Quibbler.Controls
{
    public class SpiderControlBaseNode
    {
        #region Fields
        private ObservableCollection<SpiderControlBaseNode> relatedNodes = new ObservableCollection<SpiderControlBaseNode>();
        #endregion

        #region Properties

        public SpiderControlBaseNode()
        {
        }

        public SpiderControlBaseNode(NewsArticle article)
        {
            if (article == null)
            {
                Article = null;
                Headline = "Not Available";
                SubHeadline = null;
                ImageUrl = null;
                PubDate = null;
            }
            else
            {
                Article = article;
                Headline = article.Headline;
                SubHeadline = article.SubHeadline;
                ImageUrl = article.ImageUrl;
                PubDate = article.PubDate;
            }
            Article = article;
        }

        public virtual ObservableCollection<SpiderControlBaseNode> RelatedNodes
        {
            get { return this.relatedNodes; }
        }


        public string Headline { get; set; }
        public string SubHeadline { get; set; }
        public string ImageUrl { get; set; }
        public string PubDate { get; set; }
        public NewsArticle Article { get; set; }
        #endregion
    }
}
